<script>
	var dogetnopw='__URL__/dogetnopw';
  var dogetnopwbyalipayno='__URL__/dogetnopwbyalipayno'
  var qybscstwenxintishi="{$qybscsto['qybscstwenxintishi']}"
</script>
<!--table部分-->
<div class='col-md-12' style='padding-top:30px'>
  <div class="col-md-8">
    <div class="panel panel-success">
      <div class="panel-heading">公告</div>
      <div class="panel-body">
        {$qybscsto['qybscstgonggao']}
      </div>
    </div>

  </div>
	
	<div  class='col-md-4'>
    <div class="panel panel-success">
      <div class="panel-heading">提取帐号密码</div>
      <div class="panel-body">
        <div class="form-group">
          <label for="alipayno">支付宝交易号</label>
          <input type="text" class="form-control" id="alipayno" placeholder="请输入 支付宝交易号">
        </div>
        <div class="form-group">
          <label for="qqno">QQ号</label>
          <input type="text" class="form-control" id="qqno" placeholder="请输入 QQ号">
        </div>
        <button class="btn btn-success" id='getnopw'>提取帐号密码</button>
      </div>
      
    </div>
    <div class="panel panel-success">
      <div class="panel-heading">忘记帐号密码</div>
      <div class="panel-body">
        <div class="form-inline">
          <div class="form-group">
            <!--<label for="exampleInputName2">Name</label>-->
            <input type="text" class="form-control" id="alipaynoII" placeholder="请输入 支付宝交易号">
          </div>
          
          <button type="submit" class="btn btn-default" id='getnopwbyalipayno'>忘记了？找回帐号密码</button>
        </div>
      </div>
    </div>
		
    
		<div id='jieguo'>
			
		</div>
	</div>
	

</div>

<script type="text/javascript">
$(function(){
	$('#getnopw').click(function(){ 
		
      
      var obj=new Object();
      var alipayno=$.trim($('#alipayno').val());
      var qqno=$.trim($('#qqno').val());

      if(alipayno==''){alert('支付宝交易号不能为空！');return;}
      if(qqno==''){alert('QQ号不能为空！');return;}

      $('#jieguo').html('');
      $('#loading').trigger('click');
      obj['alipayno']=alipayno;
      obj['qqno']=qqno;



      $.ajax({
          'type': 'GET',
          'url':dogetnopw,
          'async':false,  
          'contentType': 'application/json',
          'data': obj,
          'dataType': 'json',
          'success': function(data) {
            $('#loading_cancel').trigger('click');
          	var rslt=data['rslt'];
          	if(rslt==0){
          		alert('企业QQ号已经派完，请联系管理员！');return;
          	}else if(rslt==1){
          		var dtupo=data['dtupo'];
          		var dtupqyqqno=dtupo['dtupqyqqno'];
          		var dtupqyqqpw=dtupo['dtupqyqqpw'];
          		var str="<br><br><b style='color:#f00'>"+qybscstwenxintishi+"</b><br><br><table class='table  table-striped  table-bordered table-hover'><tr><td>企业QQ号码</td><td>"+dtupqyqqno+"</td></tr><tr><td>企业QQ密码</td><td>"+dtupqyqqpw+"</td></tr></table>";
                $('#jieguo').html(str);
          	}else if(rslt==2){
          		alert('未找到您的支付宝交易号，请与管理员核实！');return;
          	}else if(rslt==3){
              alert('该支付宝账号已经提取过了！');return;
            }

            console.log("success");
          },
          'error':function() {
            console.log("error");
          }
      });
	    
	})


  $('#getnopwbyalipayno').click(function(){ 
    
      
      var obj=new Object();
      var alipayno=$.trim($('#alipaynoII').val());
      
      if(alipayno==''){alert('支付宝交易号不能为空！');return;}
      $('#jieguo').html('');
      $('#loading').trigger('click');
      obj['alipayno']=alipayno;
      

      $.ajax({
          'type': 'GET',
          'url':dogetnopwbyalipayno,
          'async':false,  
          'contentType': 'application/json',
          'data': obj,
          'dataType': 'json',
          'success': function(data) {
            $('#loading_cancel').trigger('click');
            var rslt=data['rslt'];
            if(rslt==0){
              alert('此交易号还未换取过企业QQ及密码！');return;
            }else if(rslt==1){
              var dtupo=data['dtupo'];
              var dtupqyqqno=dtupo['dtupqyqqno'];
              var dtupqyqqpw=dtupo['dtupqyqqpw'];
              var str="<br><br><b style='color:#f00'>"+qybscstwenxintishi+"</b><br><br><table class='table  table-striped  table-bordered table-hover'><tr><td>企业QQ号码</td><td>"+dtupqyqqno+"</td></tr><tr><td>企业QQ密码</td><td>"+dtupqyqqpw+"</td></tr></table>";
                $('#jieguo').html(str);
            }

            console.log("success");
          },
          'error':function() {
            console.log("error");
          }
      });
      
  })
})
</script>

